package com.hll.api.controller.xinhua;

import com.hll.api.config.web.RespMessage;
import com.hll.api.service.XinhuaService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;

/**
 * @author 何龙
 * @create 2019-07-11 21:32
 */
@RestController
@RequestMapping("/api/xinhua/product")
public class ProductController {
	@Resource
	XinhuaService service;
	/** 商品详情 */
	@GetMapping("/{itemId}")
	public RespMessage productInfo(@PathVariable String itemId){
		return RespMessage.success(service.getProductDetails(itemId),null);
	}

	/** 商品其他数据 */
	@GetMapping("/other/data/{itemId}")
	public RespMessage otherData(@PathVariable String itemId) throws Exception {
		return RespMessage.success(service.getOtherData(itemId),null);
	}

	@GetMapping("/outer/category/{itemId}")
	public RespMessage otherCategory(@PathVariable String itemId) throws Exception {
		return RespMessage.success(service.getOtherCategory(itemId),null);
	}



}
